package com.zthz.douxing.convert

class K780WeathService {

    /**
     *
     * @param source
     * @param param 是上下文转换的通道。类似于pipeline
     * @return
     */
    def convert(def source, param = [:] ) {
        def result = [:]
        def fields = ["weather","wind_direction","wind_power","temperature"]
        if(source.result){
            fields.each { it ->
                result[it] = source.result[it]
            }
            result['weather_type_day'] = source.result?.weatid
            result['weather_type_night'] = source.result?.weatid1

        }
        param.target = result
    }
}
